package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.CityOnlineBean;
import com.common.retrofit.service.HaiNingService;


import rx.Observable;
import rx.Subscriber;

public class CityMethods extends BaseMethods {

    private static CityMethods m_ins = null;

    public static CityMethods getInstance() {
        if (m_ins == null) {
            synchronized (CityMethods.class) {
                if (m_ins == null) {
                    m_ins = new CityMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Index/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }

    // 获取首页数据
    public void city_data(Subscriber<CityOnlineBean> subscriber) {
        Observable observable = initService().city_data(System.currentTimeMillis() + "",
                "70ffcb2a3569065c4420776b8a81809b");
        toSubscribe(observable, subscriber);
    }
}
